//
//  SegmentButton.swift
//  Landmarks
//
//  Created by apple on 2024/5/28.
//  Copyright © 2024 pc. All rights reserved.
//

import SwiftUI

struct SegmentButton: View {
    @Binding var selectIndex:Int
    
    private let titleList:[String] = [
        "PUSH",
        "PRESENT"
    ]
    
    var body: some View {
        Picker("Choice Style", selection: $selectIndex) {
            ForEach(0 ..< titleList.count,id: \.self) {
                Text(self.titleList[$0])
            }
        }
        .pickerStyle(.segmented)
    }
    
}

#Preview {
    SegmentButton(selectIndex: .constant(0))
}
